package cn.cloud9;

import java.util.Calendar;
import java.util.Random;

public class Demo14GetFebDaysByYear {

    public static void main(String[] args) {
        int year = new Random().nextInt(100) + 2000;
        Calendar c = Calendar.getInstance();
        c.set(year, Calendar.MARCH, 1);
        c.add(Calendar.DATE, -1);
        int day = c.get(Calendar.DATE);
        System.out.printf("%d年的2月 有%d天\n", year, day);
    }
}
